package com.tea.api;

import com.tea.common.dto.TeaAddDto;
import com.tea.common.vo.R;
import com.tea.feign.TeaLeafService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "茶叶相关")
@RestController
@RequestMapping("/api/tealeaf/")
public class TeaLeafApi {
    @Resource
    private TeaLeafService service;
    @ApiOperation("新增茶叶")
    @PostMapping("add.do")
    public R add(@RequestBody TeaAddDto dto){
        return service.add(dto);
    }
    @ApiOperation("查询指定茶园茶叶")
    @GetMapping("select.do")
    public R select(@RequestParam int tgid){
        return service.select(tgid);
    }
}
